 <style type="text/css">
		html,code{font:15px/22px arial,sans-serif}
		html{background:#fff;color:#222}
		html,body{margin:0;padding:0}
</style>
	
<script src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery.nicescroll.min.js"></script>

        
<h3 style="color:#770777;">Latest Messages</h3>

<?php 
$con=Message::getList('MESSAGE-LIST', array('type'=>'guest')); ?>
<div style="width:400;height:200;" id="mesg" class="boxscroll">
<?php foreach($con as $cont) { ?>
<div>
<img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/Flower_heart.jpg" />
</div>
<div style="margin-left: 70px; margin-top: -40px;color:#770777;">
<?php echo $cont->message ; ?> 
</div>
<div style="color:yellow;">
<?php
$datetime = strtotime($cont->created);
$mysqldate = date("d/m/y g:i A", $datetime);
?>
<br>
<span style="padding-left: 70px;font-size: 1.1em;padding-top: 5px"><?php echo 'from '.$cont->name.' on '.$mysqldate; ?> </span>
</div>

<?php 

} 
 	


 ?>

	</div>

	<div style="margin-top: 20px;">
<?php if(Yii::app()->user->hasFlash('success')){?>
  <div class="flash-success" style="color:red; width=10px">
     <?php echo Yii::app()->user->getFlash('success');?></div>
<?php }?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'guest-book-form',
	'enableAjaxValidation'=>false,
)); ?>

  <div id="result" style="margin-left: 195px;
position: absolute;"></div>
<div>
		<label style="color:#770777;">Enter Name :</label><br><input type="text"  name='item1' id='example1' value="" >
</div>
<div>
		<label style="color:#770777;">Enter Email ID :</label><br><input type="text"  name='item2' id='example2' value="" >
</div>
<div>
		<label style="color:#770777;">Enter Your Message :</label><br><textarea name="item3" cols="50" rows="7" id="example3"></textarea>
</div>


<div class="row buttons">
		    <?php echo CHtml::ajaxSubmitButton('send',CHtml::normalizeUrl(array('booklet/guestbook')),array('success'=>'js: function(data) {
                        $("#result").html(data);
                        if(data=="your message send successfully!"){
                        $("#example1").val("");
                        $("#example2").val("");
                        $("#example3").attr("value","");
                        $("#closeJobDialog1").trigger("click");
                        
                          
                          }
                                         }'),array('id'=>'closeJobDialog')); ?>
	</div>
  
  <div id="trig">
		    <?php echo CHtml::ajaxLink('',CHtml::normalizeUrl(array('booklet/ajax_guest')),array('success'=>'js: function(data) {
                        $("#mesg").html(data);
                       
                                         }'),array('id'=>'closeJobDialog1')); ?>
	</div>
<?php $this->endWidget(); ?>
</div>

<script>
  $(document).ready(function() {
  	  $(".boxscroll").niceScroll({cursorborder:"",cursorcolor:"#00F",boxzoom:true}); // First scrollable DIV
  	});
  </script>